from selenium.webdriver.common.by import By
from base import Base
class Page(Base):
    # 第一步搜索
    def sou(self):    # 安卓定位
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().className("android.widget.RelativeLayout").instance(3)')
        ele=self.find_loc(loc)
        return ele
    # 第二步输入搜索内容
    def ersou(self):  # CLASS_NAME定位
        loc=(By.CLASS_NAME,'android.widget.EditText')
        ele=self.find_loc(loc)
        return ele
    # 第三步点击搜索按钮
    def souanniu(self):  # ID定位
        loc=(By.ID,'com.achievo.vipshop:id/tv_search')
        ele=self.find_loc(loc)
        return ele
    # 第四步点击查看商品信息
    def xinxi(self):  # XPATH定位
        loc=(By.XPATH,'(//android.widget.RelativeLayout[@resource-id="com.achievo.vipshop:id/image_main_layout"])[1]/android.widget.FrameLayout')
        ele=self.find_loc(loc)
        return ele
    # 第五步上滑屏幕
    def shanghua(self):
        self.hua(414,1557,414,535)
    # 第六步轻敲评轮
    def pinglun(self):
        loc = (By.XPATH,'//android.widget.TextView[@resource-id="com.achievo.vipshop:id/tv_reputation"]')
        ele = self.find_loc(loc)
        return ele
    # 断言1
    def duanyan(self):
        loc=(By.XPATH,'//android.widget.TextView[@resource-id="com.achievo.vipshop:id/tag_titles"]')
        ele=self.find_loc(loc)
        return ele
    # # 断言2
    # def duanyan2(self):
    #     loc = (By.XPATH,'//android.widget.TextView[@resource-id="com.achievo.vipshop:id/tag_titles"]')
    #     ele = self.find_loc(loc)
    #     return ele
